<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>直推服务商</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>

</head>
<body>
  <div id="blank" class="header" v-cloak>
      <div v-back.tapmode class="back small"></div>
      <span class="title">店铺规模</span>
  </div>
    <div class="container" id="app" v-cloak style="padding-top:60px;">
        <div class="myshop-top" :class="BSImg">
          <span class="shop-word">店铺规模（人）</span>
          <span class="shop-number">{{infos.team_info.sub_shop_count_l1+infos.team_info.sub_member_count_bshop}}</span>
        </div>
        <div class="myshop-middle">
            <div>
                <p>{{infos.team_info.sub_shop_count_l1?infos.team_info.sub_shop_count_l1:0}}</p>
                <p>加盟店（家）</p>
            </div>
            <div>
                <p>{{infos.team_info.sub_member_count_bshop?infos.team_info.sub_member_count_bshop:0}}</p>
                <p>顾客总数（人）</p>
            </div>

        </div>
        <div class="myshop-gaps" v-if="infos.sub_shops.length > 0">
          加盟店列表
        </div>
        <div class="mycustomer-bottom">
          <div class="mycustomer-container" v-for="(content, index) in infos.sub_shops">
            <div class="mycustomer-avatar" style="padding-left:2px;width:60px;height:60px;">
            <img :src="content.portrait || '../../image/portrait_moren.png'">
            </div>
            <div class="mycustomer-title" style="padding-left:20px">
              <span style="font-size:18px">{{content.nickname}}</span>
              <span>
                <span>店主</span>
                <span style="color:#CC0202;padding-left:10px">{{content.sub_member_count_bshop}}</span>
                <span style="padding-left:10px">销售额</span>
                <span style="color:#CC0202;padding-left:10px">￥{{content.total_consume?content.total_consume:0}}</span>
            </span>
            </div>
          </div>
        </div>
    </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script>

    var infos;
    apiready = function () {
        setBSImg();
        showProgress();
        new Vue({
            el: '#blank'
        });
        var data = {
            member_id: getPrefs('member_id')
        }
        var callback = function (ret) {
            infos = ret.content;
            initApp();
            api.parseTapmode();
        };
        pinet.post(URL.getSubshopinfo, data, callback);

        addListeners();
    };

    function initApp() {
        new Vue({
            el: '#app',
            data:{
                infos:infos,
                BSImg: {
                    big: Vue.BSImg == 'big',
                    small: Vue.BSImg == 'small'
                }
            }
        })
    }

    function addListeners() {
        api.addEventListener({
            name: 'viewappear'
        }, function () {
            onPageStart();
        });

        api.addEventListener({
            name: 'viewdisappear'
        }, function (ret, err) {
            onPageEnd();
        });

        api.addEventListener({
            name: 'keyback'
        }, function (ret, err) {
            onPageEnd();
            api.closeWin();
        });
    }


</script>
</html>
